Class HCC.DT.HCC2HL72.PathTestUpd Extends Ens.DataTransformDTL [ DependsOn = (EnsLib.EDI.XML.Document, EnsLib.HL7.Message) ]
{

Parameter IGNOREMISSINGSOURCE = 1;

Parameter REPORTERRORS = 1;

Parameter TREATEMPTYREPEATINGFIELDASNULL = 0;

XData DTL [ XMLNamespace = "http://www.intersystems.com/dtl" ]
{
<transform sourceClass='EnsLib.EDI.XML.Document' targetClass='EnsLib.HL7.Message' sourceDocType='POOR_IN200901UV:POOR_IN200901UV' targetDocType='2.5.1:CSU_C09' create='new' language='objectscript' >
<assign value='source.{id(1).extension}' property='target.{MSH:MessageControlID}' action='set' />
<assign value='source.{creationTime(1).value}' property='target.{MSH:DateTimeOfMessage.Time}' action='set' />
<assign value='"CSU"' property='target.{MSH:MessageType.MessageCode}' action='set' />
<assign value='"C09"' property='target.{MSH:MessageType.TriggerEvent}' action='set' />
<assign value='source.{controlActProcess().subject().choice.observationRequest().id().item().extension}' property='target.{PIDgrp(1).CSPgrp(1).CSSgrp(1).ORCgrp(1).ORC:PlacerOrderNumber}' action='set' />
<assign value='##class(HCC.Utils.Functions).GetDataByXPath(source.{controlActProcess(1).subject(1).choice.observationRequest(1).effectiveTime},"//s:low/@value")' property='target.{PIDgrp(1).CSPgrp(1).CSSgrp(1).ORCgrp(1).ORC:OrderEffectiveDateTime.Time}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).author.time.value}' property='target.{PIDgrp().CSPgrp().CSSgrp().ORCgrp().OBR:RequestedDateTime}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).author.assignedEntity(1).id.item(1).extension}' property='target.{PIDgrp().CSPgrp().CSSgrp().ORCgrp().ORC:OrderingProvider(1).IDNumber}' action='set' />
<assign value='##class(HCC.Utils.Functions).GetDataByXPath(source.{controlActProcess(1).subject(1).choice.observationRequest(1).author.assignedEntity(1).choice.assignedPerson.name(1)},"//s:item/s:part/@value")' property='target.{PIDgrp().CSPgrp().CSSgrp().ORCgrp().ORC:OrderingProvider().FamilyName}' action='set' />
<assign value='##class(HCC.Utils.Functions).GetDataByXPath(source.{controlActProcess(1).subject(1).choice.observationRequest(1).verifier(1).assignedEntity(1).choice.assignedPerson.name(1)},"//s:item/s:part/@value")' property='target.{PIDgrp().CSPgrp().CSSgrp().ORCgrp().ORC:VerifiedBy(1).FamilyName}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).verifier(1).time.value}' property='target.{PIDgrp().CSPgrp().CSSgrp().ORCgrp().ORC:VerifiedBy().EffectiveDate}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).verifier(1).assignedEntity(1).id.item(1).extension}' property='target.{PIDgrp().CSPgrp().CSSgrp().ORCgrp().ORC:VerifiedBy().IDNumber}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).component2(1).choice.observationRequest(1).methodCode.item(1).code}' property='target.{PIDgrp().CSPgrp().CSSgrp().ORCgrp(1).OBR:ProcedureCode.Identifier}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).component2(1).choice.observationRequest(1).methodCode.item(1).displayName.value}' property='target.{PIDgrp().CSPgrp().CSSgrp().ORCgrp().OBR:ProcedureCode.Text}' action='set' />
<assign value='##class(HCC.Utils.Functions).GetDataByXPath(source.{controlActProcess(1).subject(1).choice.observationRequest(1).component2(1).choice.observationRequest(1).location(1).time},"//s:low/@value")' property='target.{PIDgrp().CSPgrp().CSSgrp().ORCgrp().OBR:ScheduledDateTime.Time}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).componentOf1.encounter(1).id(1).item(2).extension}' property='target.{PIDgrp(1).PV1grp.PV1:VisitNumber.IDNumber}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).componentOf1.encounter(1).code.code}' property='target.{PIDgrp().PV1grp.PV1:AdmissionType}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).componentOf1.encounter(1).code.displayName.value}' property='target.{PIDgrp().PV1grp.PV1:PatientClass}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).componentOf1.encounter(1).location(1).serviceDeliveryLocation(1).location.asLocatedEntityPartOf(1).location(1).id.item(1).extension}' property='target.{PIDgrp().PV1grp.PV1:AssignedPatientLocation.Room}' action='set' />
<assign value='##class(HCC.Utils.Functions).GetDataByXPath(source.{controlActProcess().subject().choice.observationRequest().componentOf1.encounter().location().serviceDeliveryLocation().serviceProviderOrganization.name},"//s:item/s:part/@value")' property='target.{PIDgrp().PV1grp.PV1:AssignedPatientLocation.Facility}' action='set' />
<assign value='##class(HCC.Utils.Functions).GetDataByXPath(source.{controlActProcess().subject().choice.observationRequest().componentOf1.encounter().subject().patient().choice.patientPerson.telecom},"//s:item/@value")' property='target.{PIDgrp().PID:PhoneNumberHome(1).TelephoneNumber}' action='set' />
<assign value='"2.5"' property='target.{MSH:VersionID}' action='set' />
<assign value='##class(HCC.Utils.Functions).GetDataByXPath(source.{controlActProcess(1).subject(1).choice.observationRequest(1).componentOf1.encounter(1).subject(1).patient(1).choice.patientPerson.addr})' property='target.{PIDgrp().PID:PatientAddress(1)}' action='set' />
<assign value='source.{controlActProcess().subject().choice.observationRequest().componentOf1.encounter().location().serviceDeliveryLocation().location.id.item().extension}' property='target.{PIDgrp().PV1grp.PV1:AssignedPatientLocation.Bed}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).componentOf1.encounter(1).subject(1).patient(1).id.item(1).extension}' property='target.{PIDgrp().PID:PatientID}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).componentOf1.encounter(1).subject(1).patient(1).choice.patientPerson.id.item(2).extension}' property='target.{PIDgrp().PID:PatientIdentifierList(1).IDNumber}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).component2(1).choice.observationRequest(1).componentOf1.encounter(1).subject(1).patient(1).choice.patientPerson.id.item(1).root}' property='target.{PIDgrp().PID:PatientIdentifierList().IdentifierTypeCode}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).componentOf1.encounter(1).subject(1).patient(1).choice.patientPerson.administrativeGenderCode.code}' property='target.{PIDgrp().PID:AdministrativeSex}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).componentOf1.encounter(1).subject(1).patient(1).choice.patientPerson.birthTime.value}' property='target.{PIDgrp().PID:DateTimeofBirth}' action='set' />
<assign value='##class(HCC.Utils.Functions).GetDataByXPath(source.{controlActProcess(1).subject(1).choice.observationRequest(1).componentOf1.encounter(1).subject(1).patient(1).choice.patientPerson.name},"//s:item/s:part/@value")' property='target.{PIDgrp().PID:PatientName(1)}' action='set' />
<assign value='source.{controlActProcess().subject().choice.observationRequest().componentOf1.encounter().subject().patient().choice.patientPerson.asCitizen().politicalNation().code().displayName.value}' property='target.{PIDgrp().PID:Nationality}' action='set' />
<assign value='source.{controlActProcess().subject().choice.observationRequest().specimen().choice.specimen().choice.specimenNatural.code().displayName.value}' property='target.{PIDgrp(1).CSPgrp(1).CSSgrp(1).ORCgrp(1).OBR:SpecimenSource.SpecimenSourceNameorCode.Text}' action='set' />
<assign value='source.{controlActProcess().subject().choice.observationRequest().specimen().choice.specimen().choice.specimenNatural.quantity.value}' property='target.{PIDgrp().CSPgrp().CSSgrp().ORCgrp().OBR:SpecimenSource.SpecimenSourceNameorCode.AlternateText}' action='set' />
<assign value='source.{controlActProcess().subject().choice.observationRequest().specimen().choice.specimen().choice.specimenNatural.quantity.unit}' property='target.{PIDgrp().CSPgrp().CSSgrp().ORCgrp().OBR:SpecimenSource.SpecimenSourceNameorCode.OriginalText}' action='set' />
<assign value='source.{controlActProcess().subject().choice.observationRequest().text.value}' property='target.{PIDgrp().CSPgrp().CSSgrp().ORCgrp().ORC:OrderStatus}' action='set' />
<assign value='source.{controlActProcess().subject().choice.observationRequest().methodCode.item().code}' property='target.{PIDgrp().CSPgrp().CSSgrp().ORCgrp().ORC:OrderType.Identifier}' action='set' />
<assign value='source.{controlActProcess().subject().choice.observationRequest().methodCode.item().displayName.value}' property='target.{PIDgrp().CSPgrp().CSSgrp().ORCgrp().ORC:OrderType.Text}' action='set' />
<assign value='source.{controlActProcess().subject().choice.observationRequest().specimen().choice.specimen().choice.specimenNatural.derivedSpecimen().choice.specimenNatural.code().displayName.value}' property='target.{PIDgrp().CSPgrp().CSSgrp().ORCgrp().OBR:SpecimenSource.SpecimenRole.Text}' action='set' />
<assign value='source.{controlActProcess().subject().choice.observationRequest().specimen().choice.specimen().choice.specimenNatural.derivedSpecimen().choice.specimenNatural.quantity.value}' property='target.{PIDgrp().CSPgrp().CSSgrp().ORCgrp().OBR:SpecimenSource.SpecimenRole.AlternateText}' action='set' />
<assign value='source.{controlActProcess().subject().choice.observationRequest().specimen().choice.specimen().choice.specimenNatural.derivedSpecimen().choice.specimenNatural.quantity.unit}' property='target.{PIDgrp().CSPgrp().CSSgrp().ORCgrp().OBR:SpecimenSource.SpecimenRole.OriginalText}' action='set' />
<assign value='source.{controlActProcess().subject().choice.observationRequest().specimen().choice.specimen().subjectOf1().choice.choice.specimenProcessStep().subject().choice.specimenInContainer().choice.containerAdditiveMaterial.code.displayName.value}' property='target.{PIDgrp().CSPgrp().CSSgrp().ORCgrp().OBR:SpecimenSource.Additives}' action='set' />
<assign value='source.{controlActProcess().subject().choice.observationRequest().specimen().choice.specimen().subjectOf1().choice.choice.specimenProcessStep().performer().choice.assignedEntity().id.item().extension}' property='target.{PIDgrp().CSPgrp().CSSgrp().ORCgrp().OBR:OrderingProvider(1).IDNumber}' action='set' />
<assign value='##class(HCC.Utils.Functions).GetDataByXPath(source.{controlActProcess().subject().choice.observationRequest().specimen().choice.specimen().subjectOf1().choice.choice.specimenProcessStep().performer().choice.assignedEntity().choice.assignedPerson.name()},"//s:item/s:part/@value")' property='target.{PIDgrp().CSPgrp().CSSgrp().ORCgrp().OBR:OrderingProvider().FamilyName}' action='set' />
<assign value='source.{controlActProcess().subject().choice.observationRequest().specimen().choice.specimen().subjectOf1().choice.choice.specimenProcessStep().performer().choice.assignedEntity().representedOrganization.id().item().extension}' property='target.{PIDgrp().CSPgrp().CSSgrp().ORCgrp().OBR:OrderingProvider(1).AssigningAgencyorDepartment.Identifier}' action='set' />
<assign value='source.{controlActProcess().subject().choice.observationRequest().subjectOf6().annotation().text().value}' property='target.{PIDgrp().NTE(1):Comment(1)}' action='set' />
<assign value='##class(HCC.Utils.Functions).GetDataByXPath(source.{controlActProcess().subject().choice.observationRequest().specimen().choice.specimen().subjectOf1().choice.choice.specimenProcessStep().performer().choice.assignedEntity().representedOrganization.name},"//s:item/s:part/@value")' property='target.{PIDgrp().CSPgrp().CSSgrp().ORCgrp().OBR:OrderingProvider().AssigningAgencyorDepartment.Text}' action='set' />
<assign value='##class(HCC.Utils.Functions).GetDataByXPath(source.{controlActProcess().subject().choice.observationRequest().componentOf1.encounter().location().serviceDeliveryLocation().serviceProviderOrganization.asOrganizationPartOf().wholeOrganization.name},"//s:item/s:part/@value")' property='target.{PIDgrp().PV1grp.PV1:AssignedPatientLocation.Floor}' action='set' />
<assign value='source.{controlActProcess().subject().choice.observationRequest().component2().choice.observationRequest().code().code}' property='target.{PIDgrp().CSPgrp().CSSgrp().ORCgrp().OBR:ProcedureCode.AlternateIdentifier}' action='set' />
<assign value='source.{controlActProcess().subject().choice.observationRequest().component2().choice.observationRequest().code().displayName.value}' property='target.{PIDgrp().CSPgrp().CSSgrp().ORCgrp().OBR:ProcedureCode.AlternateText}' action='set' />
<assign value='source.{controlActProcess().subject().choice.observationRequest().component2().choice.observationRequest().location().serviceDeliveryLocation().serviceProviderOrganization.id().item().extension}' property='target.{PIDgrp().CSPgrp().CSSgrp().ORCgrp().ORC:EnteringOrganization.Identifier}' action='set' />
<assign value='##class(HCC.Utils.Functions).GetDataByXPath(source.{controlActProcess().subject().choice.observationRequest().component2().choice.observationRequest().location().serviceDeliveryLocation().serviceProviderOrganization.name},"//s:item/s:part/@value")' property='target.{PIDgrp().CSPgrp().CSSgrp().ORCgrp().ORC:EnteringOrganization.Text}' action='set' />
<assign value='source.{controlActProcess().subject().choice.observationRequest().component2().choice.observationRequest().targetSiteCode.item().code}' property='target.{PIDgrp().CSPgrp().CSSgrp().ORCgrp().OBR:ProcedureCodeModifier(1).Identifier}' action='set' />
<assign value='source.{controlActProcess().subject().choice.observationRequest().component2().choice.observationRequest().targetSiteCode.item().displayName.value}' property='target.{PIDgrp().CSPgrp().CSSgrp().ORCgrp().OBR:ProcedureCodeModifier().Text}' action='set' />
<assign value='source.{controlActProcess().subject().choice.observationRequest().componentOf1.encounter().pertinentInformation1().observationDx().code().displayName.value}' property='target.{PIDgrp().CSPgrp().CSSgrp().ORCgrp().OBR:ReasonforStudy(1).Text}' action='set' />
<assign value='source.{controlActProcess().subject().choice.observationRequest().componentOf1.encounter().pertinentInformation1().observationDx().value().displayName.value}' property='target.{PIDgrp().CSPgrp().CSSgrp().ORCgrp().OBR:ReasonforStudy().AlternateText}' action='set' />
</transform>
}

}
